import request from '@/utils/request'

/**
 * 新增设备标签
 * @param {Object} data
 * @returns
 */
export function addDeviceTag(data) {
  return request({
    url: '/machine/tagMachine',
    headers: { repeatSubmit: false },
    method: 'post',
    data
  })
}

/**
 * 修改
 * @param {Object} data
 * @returns
 */
export function updateDeviceTag(data) {
  return request({
    url: '/machine/tagMachine',
    method: 'put',
    data
  })
}

/**
 * 详情
 * @param {String} id
 * @returns
 */
export function getTagDetail(id) {
  return request({
    url: `/machine/tagMachine/${id}`,
    method: 'get'
  })
}

/**
 * 管理
 * @param {Object} params
 * @returns
 */
export function getDeviceTagList(params) {
  return request({
    url: '/machine/tagMachine',
    method: 'get',
    params
  })
}

export function disableTag(id) {
  return request({
    url: `/machine/tagMachine/disabled/${id}`,
    method: 'get'
  })
}
